package com.qdsg.ysg.doctor.util;

import android.annotation.SuppressLint;

import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeUtil {

    public static String getClientId() {
        return System.currentTimeMillis() + "" + (int) ((Math.random() * 9 + 1) * 10000);
    }

    public static String getAllTime(Date date) {//可根据需要自行截取数据显示
        @SuppressLint("SimpleDateFormat") SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd" );
        return format.format( date );
    }

    public static String getTime(Date date) {//可根据需要自行截取数据显示
        @SuppressLint("SimpleDateFormat") SimpleDateFormat format = new SimpleDateFormat( "MM月dd" );
        return format.format( date );
    }

    public static String getSystemTime(Date date) {
        @SuppressLint("SimpleDateFormat") SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd HH:mm" );
        return format.format( date );
    }

}


